package com.ck.ips.service;

import com.ck.common.model.OperationResult;
import com.ck.ips.core.listener.event.LoginSuccessEvent;

/**
* @Description: 登录 service
* @Author: hf
* @Date:    2019/4/29 9:53
* @Version: 1.0
*/
public interface LoginService {

	/**
	 * 登录业务
	 * @param userName
	 * @param password
	 * @param imageCode
	 * @param remoteIP
	 * @return
	 */
	OperationResult doLogin(String userName, String password, String imageCode, String remoteIP);

	/**
	 * 冻结用户登录
	 * @param userName
	 * @return
	 */
	OperationResult freeze(String userName);

	/**
	 * 移除登录失败相关缓存
	 * @param userName
	 * @return
	 */
	OperationResult removeLoginFailCache(String userName);

	/**
	 * 保存用户登录成功记录
	 * @param loginSuccessEvent
	 * @return
	 */
	OperationResult saveLoginSuccessRecord(LoginSuccessEvent loginSuccessEvent);

	/**
	 * h5登录
	 * @param userName 用户名
	 * @param password 密码
	 * @param imageCode 图片验证码
	 * @param remoteIP 登录ip
	 * @return
	 */
	OperationResult doH5Login(String userName, String password, String imageCode, String remoteIP);
}
